<template>
  <div>
    <div id="mainLine"></div>
  </div>
</template>

<script>
import * as echarts from "echarts";
export default {
  name: "completeCharts",
  data() {
    return {};
  },
  mounted() {
    this.showChart();
  },
  methods: {
    showChart() {
      var chartDom = document.getElementById("mainLine");
      var myChart = echarts.init(chartDom);
      var option;

      option = {
        xAxis: {
          type: "category",
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: "line",
          },
        ],
      };

      option && myChart.setOption(option);
    },
  },
};
</script>

<style lang="scss">
#mainLine {
  width: 500px;
  height: 200px;
}
</style>
